package test;
//定义方法，计算1到某个数以内能被7或者3整除但不能同时被这两者整除的数的个数。
public class ThreeYesOrNoSeventeen {
    public static void main(String[] args) {
        int num = 10;
        int sum = ifDivdeNumberSum(num);
        System.out.println(sum);
    }
    private static int ifDivdeNumberSum(int num) {
        int sum = 0;
        for (int i = 1; i <= num ; i++) {
            boolean a = i % 7 == 0 || i % 3 == 0;
            boolean b = !(i % 7 == 0 && i % 3 == 0);
            if (a && b){
                sum += i;
            }
        }
        return sum;
    }
}
